using System;
using System.Collections;
using System.Web;

namespace Sedna.Core.Controller.Common
{
	/// <summary>
	/// TrivialExceptionHandler does nothing, except returning IActionResult with successStatus.
	/// This enables you to attach any action to the exception handler easily. 
	/// 
	/// It is derived from AbstractSednaExceptionHandler, so it can be used in collaboration with
	/// SednaExceptionCodeBasedExceptionHandlerMatcher.
	/// </summary>
	public class TrivialExceptionHandler: AbstractSednaExceptionHandler
	{
		public TrivialExceptionHandler()
		{
			exceptionType=typeof(Exception);
		}

		public override IActionResult HandleException(IExecutionContext executionContext, Exception exception)
		{
			return new ActionResult(successStatus);
		}
	}
}
